package com.example.service;

import com.example.dao.ProblemTagDao;
import com.example.model.pojo.ProblemTag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description //TODO
 * @Date 2022/9/14 15:28
 * @Author lonng
 **/
@Service
public class ProblemTagServiceImpl implements ProblemTagService{
    @Autowired
    private ProblemTagDao problemTagDao;
    @Override
    public List<Integer> findAllByTid(Integer id) {
        List<Integer> lists=new ArrayList();
        for(ProblemTag problemTag:problemTagDao.findAllByTid(id)){
            lists.add(problemTag.getPid());
        }
        return lists;
    }

    @Override
    public List<Integer> findAllByPid(Integer id) {
        List<Integer> list=new ArrayList<>();
        for(ProblemTag pT:problemTagDao.findAllByPid(id)){
            list.add(pT.getTid());
        }
        return list;
    }

}
